package com.study.funny.controller;

import com.study.funny.grpc.GrpcClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: GrpcClientController
 * @Description: 客户端 controller
 * @Author: funny
 * @CreateTime: 2025-01-05 22:47
 * @Version: 1.0
 **/
@RestController
@RequestMapping("/grpc")
public class GrpcClientController {

    @Autowired
    private GrpcClientService grpcClientService;

    @RequestMapping("/printMessageOne")
    public String printMessageOne(@RequestParam(defaultValue = "funny") String name) {
        return grpcClientService.sendMessageOne(name);
    }

    @RequestMapping("/printMessageTwo")
    public String printMessageTwo(@RequestParam(defaultValue = "funny") String name) {
        return grpcClientService.sendMessageTwo(name);
    }
}
